package com.ruoyi.plan.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.plan.mapper.SysPlanMapper;
import com.ruoyi.plan.domain.SysPlan;
import com.ruoyi.plan.service.ISysPlanService;

/**
 * 计划信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-12
 */
@Service
public class SysPlanServiceImpl implements ISysPlanService 
{
    @Autowired
    private SysPlanMapper sysPlanMapper;

    /**
     * 查询计划信息
     * 
     * @param planId 计划信息主键
     * @return 计划信息
     */
    @Override
    public SysPlan selectSysPlanByPlanId(Long planId)
    {
        return sysPlanMapper.selectSysPlanByPlanId(planId);
    }

    /**
     * 查询计划信息列表
     * 
     * @param sysPlan 计划信息
     * @return 计划信息
     */
    @Override
    public List<SysPlan> selectSysPlanList(SysPlan sysPlan)
    {
        return sysPlanMapper.selectSysPlanList(sysPlan);
    }

    /**
     * 新增计划信息
     * 
     * @param sysPlan 计划信息
     * @return 结果
     */
    @Override
    public int insertSysPlan(SysPlan sysPlan)
    {
        sysPlan.setCreateTime(DateUtils.getNowDate());
        return sysPlanMapper.insertSysPlan(sysPlan);
    }

    /**
     * 修改计划信息
     * 
     * @param sysPlan 计划信息
     * @return 结果
     */
    @Override
    public int updateSysPlan(SysPlan sysPlan)
    {
        return sysPlanMapper.updateSysPlan(sysPlan);
    }

    /**
     * 批量删除计划信息
     * 
     * @param planIds 需要删除的计划信息主键
     * @return 结果
     */
    @Override
    public int deleteSysPlanByPlanIds(Long[] planIds)
    {
        return sysPlanMapper.deleteSysPlanByPlanIds(planIds);
    }

    /**
     * 删除计划信息信息
     * 
     * @param planId 计划信息主键
     * @return 结果
     */
    @Override
    public int deleteSysPlanByPlanId(Long planId)
    {
        return sysPlanMapper.deleteSysPlanByPlanId(planId);
    }
}
